<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>strxfrm</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_009_249">&nbsp;</a>NAME</h4><blockquote>
strxfrm - string transformation
</blockquote><h4><a name = "tag_000_009_250">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="string.h.html">string.h</a>&gt;

size_t strxfrm(char *<i>s1</i>, const char *<i>s2</i>, size_t <i>n</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_009_251">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>strxfrm()</i>
function transforms the string pointed to by
<i>s2</i>
and places the resulting string into the array pointed to by
<i>s1</i>.
The transformation is such that if
<i><a href="strcmp.html">strcmp()</a></i>
is applied to two transformed strings, it returns a value greater than, equal
to or less than 0, corresponding to the result of
<i><a href="strcoll.html">strcoll()</a></i>
applied to the same two original strings.  No more than
<i>n</i>
bytes are placed into the resulting array pointed to by
<i>s1</i>,
including the terminating null byte.  If
<i>n</i>
is 0,
<i>s1</i>
is permitted to be a null pointer.  If copying takes place between objects
that overlap, the behaviour is undefined.
<p>
The
<i>strxfrm()</i>
function will not change the setting of 
<b>errno</b>
if successful.
<p>
Because no return value is reserved to indicate an error, an
application wishing to check for error situations should set
<i>errno</i>
to 0, then call
<i><a href="strcoll.html">strcoll()</a></i>,
then check
<i>errno</i>.
</blockquote><h4><a name = "tag_000_009_252">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion,
<i>strxfrm()</i>
returns the length of the transformed string (not including the terminating
null byte).  If the value returned is
<i>n</i>
or more, the contents of the array pointed to by
<i>s1</i>
are indeterminate.
<p>
On error,
<i>strxfrm()</i>
may set
<i>errno</i>
but no return value is reserved to indicate an error.
</blockquote><h4><a name = "tag_000_009_253">&nbsp;</a>ERRORS</h4><blockquote>
The
<i>strxfrm()</i>
function may fail if:
<dl compact>

<dt>[EINVAL]<dd>
The string pointed to by
the
<i>s2</i>
argument contains characters outside the domain of the collating
sequence.

</dl>
</blockquote><h4><a name = "tag_000_009_254">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_255">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The transformation function is such that two transformed strings
can be ordered by
<i><a href="strcmp.html">strcmp()</a></i>
as appropriate to collating sequence information in the
program's locale (category 
<a href="../xbd/locale.html#tag_005_003_002">LC_COLLATE</a>).
<p>
The fact that when
<i>n</i>
is 0,
<i>s1</i>
is permitted to be a null pointer, is useful to determine the size of the
<i>s1</i>
array prior to making the transformation.
</blockquote><h4><a name = "tag_000_009_256">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_257">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="strcmp.html">strcmp()</a></i>,
<i><a href="strcoll.html">strcoll()</a></i>,
<i><a href="string.h.html">&lt;string.h&gt;</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the ISO C standard.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

